<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>告警管理</title>
	<meta name="decorator" content="default"/>
	<tags:import includes="spinner,bootbox,form,chosen,chosenCss"></tags:import>
	<script src="${ctxStatic}/modules/core/user.js"></script>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#frmSearch").submit();
			return false;
		}
	</script>
</head>
<body>
	<br>
		<form id="frmSearch" modelAttribute="user" action="${ctx}/core/user/"  method="post"  class="breadcrumb form-search">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>		
			<!--添加查询条件-->
			<label>登录名 ：</label><input type="text" name="loginName"  value="${user.loginName}"  htmlEscape="false" maxlength="64" class="input-medium"/>
			&nbsp;&nbsp;<label>用户名 ：</label><input type="text" name="name"  value="${user.name}"  htmlEscape="false" maxlength="64" class="input-medium"/>
			&nbsp;&nbsp;<label>角色 ：</label><widgets:select dictName="roles"  value="${user.roles}"  datasource="${fns:getDictList('sys_roles')}"  dataPlaceholder="角色"></widgets:select>
			<br><br>
			<input id="btnQuery" class="btn btn-success"" type="button" value="查询"/>
		    &nbsp;<button type="button" class="btn" id="btnNew">新增</button>					
		    &nbsp;<button type="button" class="btn" id="btnDelete">删除</button>
		</form>			    
	<br><br>
	<%-- <tags:message content="${message}"/> --%>
	<table id="contentTable" class="table table-striped table-bordered  table-hover">		
		<thead>
		<tr>
			<th class="center" style="width: 50px;">
					<label> <input 
					type="checkbox" class="ace" /> 
							<span class="lbl"></span>
					</label>
			</th>
	        <th>登录名</th>
	        <th>用户名</th>
	        <th>角色</th>
	        <th>注册时间</th>
			<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${pages.list}" var="user">
		<tr>
		<td class="center">
			<label>
				<input value="${user.id}" type="checkbox" class="ace" /> 
				<span class="lbl"></span>
			</label>
		</td>
                 <td>${user.loginName}</td>
                 <td>${user.name}</td>
                 <td>${fns:getDictLabel(user.roles, "sys_roles", "N/A")}</td>
                 <td>${user.registerDate}</td>
		<td>
			<a href="javascript:onDelete('${user.id}')">删除</a>
			<a href="javascript:onUpdate('${user.id}')">编辑</a>
		</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>	
	${pages}
	<!-- 模态窗体 -->
	<div id="modalTable" action="new" class="modal fade" tabindex="-1" style="display:none;width: 402px;height: 335px;">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 400px; height: 100%;">
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>新增窗体</span>
					</div>
				</div>
				<br>
				<!-- 新增窗体内部 -->
				<form id="frmSubmit" class="form-horizontal" role="form"
					method="post">
					<input type="hidden" name="sort" value="30" uname="update"/>
					<input type="hidden" name="id" uname="update"/>
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">登录名 : </label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="loginName" uname="update"/>
							</div>
						</div>						
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">用户名 : </label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="name" uname="update"/>
							</div>
						</div>						
				        <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">密码 : </label>
							<div class="col-sm-9">
								<input type="password" class="col-xs-10"
									name="plainPassword" uname="update"/>
							</div>
						</div>		
						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">角色 : </label>
							<div class="col-sm-9">
								<widgets:select datasource="${fns:getDictList('sys_roles')}"  width="130" dictName="roles" dataPlaceholder="字典类型"></widgets:select>								
							</div>
						</div>										
							
				      <!--   <div class="form-group">
							<label class="col-sm-3 control-label no-padding-right">角色</label>
							<div class="col-sm-9">
								<input type="text" class="col-xs-10"
									name="roles" uname="update"/>
							</div>
						</div>		 -->				

					<div class="space-4"></div>
					<div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9"  style="text-align:center;">
							<button id="btnSubmit" class="btn btn-info" type="button">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
							&nbsp; &nbsp; &nbsp;
							<button class="btn" type="reset">
								<i class="icon-undo bigger-110"></i> 重置
							</button>
						</div>
					</div>
				</form>
				<!-- PAGE CONTENT ENDS -->
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
</body>
</html>
